package pulpfizz.physics;


import org.jbox2d.common.Vec2;
import org.jbox2d.dynamics.Body;
import org.jbox2d.dynamics.BodyDef;
import org.jbox2d.dynamics.World;

public class PhysicsUtils
{
	/**
	 * In case you want to do something to a body during each creation (such as add an Actor object),
	 * you can override the PhysicsUtils class and override this method.
	 * @return
	 */
	public static BodyDef newBodyDef()
	{
		BodyDef bd = new BodyDef();
		return bd;
	}

	/**
	 * Returns the clockwise angle from vector A to vector B.
	 * @param a
	 * @param b
	 * @return
	 */
	public static float angle(Vec2 a, Vec2 b)
	{
		return angle(b) - angle(a);
	}
	
	/**
	 * Returns the clockwise angle of vector A, relative to the horizontal.
	 * @param a
	 * @return
	 */
	public static float angle(Vec2 a)
	{
		float theta = (float)Math.atan2(a.y, a.x);
		return theta;
	}

}
